// Outer wrapper
// stylelint-disable selector-max-type
.tabnav {
  margin-top: 0;
  margin-bottom: $spacer-3;
  border-bottom: $border;
}

.tabnav-tabs {
  display: flex;
  // stylelint-disable-next-line primer/spacing
  margin-bottom: -1px;
  overflow: auto;
}

.tabnav-tab {
  display: inline-block;
  flex-shrink: 0;
  padding: $spacer-2 $spacer-3;
  font-size: $h5-size;
  // stylelint-disable-next-line primer/typography
  line-height: 23px;
  color: $text-gray-dark;
  text-decoration: none;
  background-color: transparent;
  border: $border-width $border-style transparent;
  border-bottom: 0;

  &.selected,
  &[aria-selected=true],
  &[aria-current]:not([aria-current=false]) {
    background-color: $bg-white;
    border-color: $border-gray;
    border-radius: $border-radius $border-radius 0 0;
  }

  &:hover,
  &:focus {
    color: $text-gray;
    text-decoration: none;
  }

  &:active {
    color: $text-gray-light;
  }

  .octicon {
    margin-right: $spacer-1;
    // stylelint-disable-next-line primer/colors
    color: $gray-400;
  }

  .Counter {
    margin-left: $spacer-1;
  }
}

// Tabnav extras
//
// Tabnav extras are non-tab elements that sit in the tabnav. Usually they're
// inline text or links.

.tabnav-extra {
  display: inline-block;
  // stylelint-disable-next-line primer/spacing
  padding-top: 10px;
  // stylelint-disable-next-line primer/spacing
  margin-left: 10px;
  font-size: $font-size-small;
  color: $text-gray;

  > .octicon {
    // stylelint-disable-next-line primer/spacing
    margin-right: 2px;
  }
}

// When tabnav-extra are anchors
// stylelint-disable-next-line selector-no-qualifying-type
a.tabnav-extra:hover {
  color: $text-blue;
  text-decoration: none;
}

// Tabnav buttons
//
// For when there are multiple buttons, space them out appropriately. Requires
// the buttons to be floated or inline-block.

.tabnav-btn {
  margin-left: $spacer-2;
}
